﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SachOnlineLibrary.DAL;
using SachOnlineLibrary.Public;
using System.Data;
/// <summary>
/// Summary description for DangNhapBLL
/// </summary>
public class DangNhapBLL
{
    TaiKhoanDAL taikhoanDAL = new TaiKhoanDAL();
	public DangNhapBLL()
	{
		//
		// TODO: Add constructor logic here
		//              
	}
    public int CheckDangNhap(String tk, String mk)
    {
        try
        {
            string kt = taikhoanDAL.LayTaiKhoan(tk, mk).Rows[0]["Quyen"].ToString();
            if (kt == "True") //Admin
            {
                return 1;
            }
            else
                return 2;
        }
        catch
        {
            return 0;
        }
    }
}